//This is a ported VBScript XML example from the MSDN article "Working with XML Document Parts"
//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/89121802-adeb-4c14-9ed9-f4cd63c6619c.asp

using System;
using System.Windows.Forms;
using Msxml2;

//css_prescript com(Msxml2.DOMDocument, Msxml2);

class Script
{
	[STAThread]
	static public void Main(string[] args)
	{
		DOMDocumentClass xmlDoc = new DOMDocumentClass();
		IXMLDOMElement rootElement = xmlDoc.createElement("memo");
		IXMLDOMAttribute memoAttribute = xmlDoc.createAttribute("author");
		IXMLDOMText memoAttributeText = xmlDoc.createTextNode("Pat Coleman");
		IXMLDOMElement toElement = xmlDoc.createElement("to");
		IXMLDOMText toElementText = xmlDoc.createTextNode("Carole Poland");
		xmlDoc.appendChild(rootElement);
		memoAttribute.appendChild(memoAttributeText);
		rootElement.setAttributeNode(memoAttribute);
		rootElement.appendChild(toElement);
		toElement.appendChild(toElementText);
		xmlDoc.save("memo.xml");
	}
}

